package com.lc.reggie.controller;


import com.lc.reggie.common.R;
import com.lc.reggie.entity.Orders;
import com.lc.reggie.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/order")
public class OrderController
{
	@Autowired
	private OrderService orderService;
	
	/**
	 * 用户下单
	 * @param orders
	 * @return
	 */
	@PostMapping("/submit")
	public R<String> submit(@RequestBody Orders orders)
	{
		log.info("订单数据：{}",orders);
		orderService.submit(orders);
		return R.success("下单成功");
	}
	
//	@GetMapping("/userPage")
//	public
	
	
}
